package com.car.action.api;

import java.util.ArrayList;
import java.util.Map;

import com.car.common.model.Topics;
import com.jfinal.core.Controller;
import com.jfinal.plugin.ehcache.CacheKit;
import com.jfinal.plugin.ehcache.IDataLoader;
import com.utils.APIJSON;

public class TopicController extends Controller {

	public void list() {
		ArrayList<Map<String,Object>> topicList = CacheKit.get("constant", "topicList", new IDataLoader(){
		       public Object load() {
		           return Topics.dao.getAll();
		}});
		renderText(APIJSON.send(topicList));
	}
	
}
